<?php

namespace app\mobile\controller;

//use controller\HomeBase;
use think\Request;
use think\Config;

class Index extends Common{

    function __construct(Request $request = null)
    {        
        parent::__construct($request);
    // }
    // public function _initialize(){
    //     parent::_initialize();
    }

    public function index(){
        // halt($this->template_dir);
        // halt(Config::get("template.view_path"));
        // halt($this->themes);
        // halt(config('template'));
        // halt(input('domain'));
        // $sName = trim($_SERVER['SERVER_NAME']);
        // $domain = input('domain');
        // $sName = $domain ? $domain : $sName;
        // halt($sName);
        // return $this->display('这里是前台首页');
        
        //$this->homeSwitch($this->themes);
        return $this->fetch();
    }

    //州级
    public function state(){
        // $arts = $this->article->getLists(['aid' => $this->aid]);
        // halt($arts);
    }

    //县级
    public function county(){
        //
    }

    //镇级
    public function town(){
        //
    }

    //村级
    public function village(){
        //
    }

    //模板数据切换
    private function homeSwitch($the){
        switch ($the) {
            // case 'state'://州
            //     $this->state();
            //     break;
            case 'county'://县
                $this->county();
                break;
            case 'town'://镇
                $this->town();
                break;
            case 'village'://村
                $this->village();
                break;
            
            default:
                $this->state();
                break;
        }
    }
}